<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="/Public/layui/css/layui.css"  media="all">
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body style="padding:15px;"> 
<form class="layui-form" action="<?php echo U('Shop/createmini');?>">
  <div class="layui-form-item">
    <label class="layui-form-label">选择模板</label>
    <div class="layui-input-block">
      <?php if(is_array($types)): foreach($types as $key=>$item): ?><input type="radio" name="type" value="<?php echo ($item["value"]); ?>" title="<?php echo ($item["title"]); ?>" <?php if($item["value"] == $info['type']): ?>checked<?php endif; ?>><?php endforeach; endif; ?>
    </div>
    <input type="hidden" name="shop_id" value="<?php echo ($info['shop_id']); ?>">
    <div class="layui-form-item" style="margin:10% 30%;">
      <button class="layui-btn" lay-submit="" lay-filter="*">下一步</button>
    </div>
  </div>
</form>
          
<script src="/Public/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
  layui.use(['form','upload'], function(){
    var form = layui.form
            ,layer = layui.layer
            ,$ = layui.jquery
            ,upload = layui.upload;

    //监听提交
    form.on('submit(*)', function(data){
      $.post("<?php echo U('Shop/createmini');?>", data.field, function(data) {
        //申请结果提示
          layer.msg(data.msg);
        setTimeout(function(){
          parent.location.reload();
        },2000)
        });
      return false;
    });


  });
</script>
</body>
</html>